package com.generate.main;

public class XMLException extends RuntimeException {

	Throwable cause = null;
    String message = null;

    public XMLException(String str) {
        this.message = str;
    }

    public XMLException(Throwable cause, String str) {
        this.cause = cause;
        this.message = str;
    }

    public String getMessage() {
        
        return message + handlerMessage(this);
    }
    
    public Throwable getCause() {
        return this.cause;
    }
    
    public String handlerMessage(Throwable exp) {
    	if (exp != null) {
	    	Throwable err = exp.getCause();
	    	if (err != null) {
	    		return handlerMessage(err);
	    	} else {
	    		return "";
	    	}
    	}
    	else {
    		return "";
    	}
    }
}
